import java.util.Random;
import java.util.Scanner;
public class TestDome {
    public static void main(String[] args) {
        String password = "zxcvbnm";
        Scanner scanner = new Scanner(System.in);
        for(int i = 0;i < 3;i++){
            System.out.println("请输入密码：");
            String passwords = scanner.nextLine();
            if(passwords.equals(password)){
                System.out.println("登录成功");
                break;
            }else if(i < 2){
                System.out.println("密码错误，请重新输入:");
            }else {
                System.out.println("程序退出");
            }
        }
    }

    public static void main19(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            for(int i = 0;i < a;i++){
                for(int j = 0;j < a;j++){
                    if(i == j || i == a -j - 1){
                        System.out.print("*");
                    }else{
                        System.out.print(" ");
                    }
                }
                System.out.println("");
            }
        }
    }
    public static void main18(String[] args) {
        Scanner scanner = new Scanner(System.in);//资源
        Random random = new Random();
        int randNum = random.nextInt(100) + 1;//[0-100)->[1-100]
        while (true){
            System.out.println("你要猜的数字：");
            int num = scanner.nextInt();
            if (randNum < num){
                System.out.println("猜大了");
            }else if(randNum > num){
                System.out.println("猜小了");
            }else {
                System.out.println("猜对了");
                break;
            }
        }
    }





    public static void main17(String[] args) {
        Scanner scanner = new Scanner(System.in);//资源

        System.out.println("请输入你的姓名： ");
        String name = scanner.nextLine();
        System.out.println("name:"+name);

        System.out.println("请输入你的年龄： ");
        int age = scanner.nextInt();
        System.out.println(age);

        System.out.println("请输入你的工资： ");
        float f = scanner.nextFloat();
        System.out.println(f);

        scanner.close();//记得关闭
    }

    public static void main16(String[] args) {
        int a = 0;
        do {
            System.out.println("haha");
        }while (a > 0);
    }
    public static void main15(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int sum = 1;
        int num = 0;
        for (int i = 1; i <= n; i++) {
            sum *= i;
            num += sum;
        }
        System.out.println(num);
    }
    public static void main14(String[] args) {
        int i = 1;
        int sum = 0;
        for ( ; ; i++) {
            //sum += i;
            System.out.println("fa");//死循环
        }
        //System.out.println(sum);
    }

    public static void main13(String[] args) {
        int sum = 0;
        for (int i = 0; i <= 10; i++) {
            sum += i;
        }
        System.out.println(sum);

        int sum2 = 0;
        int j = 1;
        while (j <= 10){
            sum2 += j;
            j++;
        }
        System.out.println(sum2);
    }

    //找到100以内能被3整除也能被5整除的数
    public static void main12(String[] args) {
        int i = 1;
        while (i <= 100){
            if (i % 15 != 0){
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }
    public static void main11(String[] args) {
        int i = 1;
        while (i <= 10){
            if (i % 3 != 0){
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }
    public static void main10(String[] args) {
        int a = 1;
        while (a < 10){
            if (a == 5){
                continue;//死循环
                //System.out.println("haha");
            }
            System.out.println(a);
            a++;
        }
    }
    public static void main9(String[] args) {
        int i = 100;
        while (i <= 200){
            if (i % 3 == 0){
                System.out.println(i);
                break;
            }
            i++;
        }
    }

    public static void main8(String[] args) {
        int a = 1;
        while (a < 10){
            if (a == 5){
                break;
            }
            System.out.println(a);
            a++;
        }
    }
    public static void main7(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int j = 1;
        int sum = 0;
        while (j <= n) {
            int ret = 1;
            int i = 1;
            while (i <= j) {
                ret *= i;
                i++;
            }
            sum += ret;
            j++;
        }
        System.out.println(sum);
    }
    public static void main6(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int ret = 1;
        int i = 1;
        while (i <= n){
            ret *= i;
            i++;
        }
        System.out.println(ret);
    }

    public static void main5(String[] args) {
        int num = 1;
        int ret = 0;
        while (num < 10){
            ret += num;
            System.out.println(num);
            num++;
        }
        System.out.println(ret);
    }
    public static void main4(String[] args) {
        int a = 1;
        switch (a) {
            case 1:
                System.out.println("1");
                break;
            case 2:
                System.out.println("2");
                break;
            default:
                System.out.println("输入有误");
                break;
        }
    }

    public static void main3(String[] args) {
        int x = 10;
        int y = 10;
        if (x == 10)
            if (y == 10)
                System.out.println("aaa");
            else
                System.out.println("bbb");
    }

    public static void main2(String[] args) {
        //随着自己写代码，代码的提示是你想要的，直接回车
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int year = scanner.nextInt();
            if (year % 100 == 0) {
                if(year % 400 == 0){
                    System.out.println(year + " is leapYear!");
                }else {
                    System.out.println(year + " is not leapYear!");
                }
            }else {
                if (year % 4 == 0) {
                    System.out.println(year + " is leapYear!");
                } else {
                    System.out.println(year + " is not leapYear!");
                }
            }
        }
    }


    public static void main1(String[] args) {
        //随着自己写代码，代码的提示是你想要的，直接回车
        Scanner scanner = new Scanner(System.in);

        while (scanner.hasNextInt()) {
            int num = scanner.nextInt();
            if (num % 2 == 0) {
                System.out.println("偶数");
            } else {
                System.out.println("奇数");
            }
        }
    }
}
